using System;

namespace TenantManagementService.Exceptions;

/// <summary>
/// 租户名称已存在异常
/// </summary>
public class TenantNameAlreadyExistsException : TenantManagementException
{
    public string TenantName { get; } = string.Empty;

    public TenantNameAlreadyExistsException()
    {
    }

    public TenantNameAlreadyExistsException(string tenantName)
        : base($"租户名称 '{tenantName}' 已存在")
    {
        TenantName = tenantName;
    }

    public TenantNameAlreadyExistsException(string tenantName, Exception innerException)
        : base($"租户名称 '{tenantName}' 已存在", "TENANT_NAME_EXISTS", innerException)
    {
        TenantName = tenantName;
    }
}